package d_用户信息.a_用户信息.b_检查加密信息;

import a_接口调用凭证.a_获取接口调用凭据.GetAccessToken;
import com.fasterxml.jackson.annotation.JsonProperty;
import d_用户信息.b_网络.a_获取用户encrytKey.GetUserEncryptKey;
import my.wechat.rc.common.HttpClientUtil;
import my.wechat.rc.common.MapUtil;
import my.wechat.rc.common.SHAUtil;

/**
 * @author 86153
 * @date 2022/8/3
 **/
public class CheckEncryptedData {

    public static CheckEncryptedDataResponse checkEncryptedData() {
        try {
            String encryptKey = "";//暂时不知道这个值怎么来的
            String accessToken = GetAccessToken.getAccessToken().getAccessToken();
            String url = "https://api.weixin.qq.com/wxa/business/checkencryptedmsg?access_token=" + accessToken;
            return HttpClientUtil.post(url, MapUtil.of("encrypted_msg_hash", encryptKey),
                    CheckEncryptedDataResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new CheckEncryptedDataResponse();
    }

    public static void main(String[] args) {
        checkEncryptedData();
    }

    public static class CheckEncryptedDataResponse {
        private Integer errcode;
        private String errmsg;
        private Boolean vaild;
        @JsonProperty("create_time")
        private Integer createTime;

        public Integer getErrcode() {
            return errcode;
        }

        public void setErrcode(Integer errcode) {
            this.errcode = errcode;
        }

        public String getErrmsg() {
            return errmsg;
        }

        public void setErrmsg(String errmsg) {
            this.errmsg = errmsg;
        }

        public Boolean getVaild() {
            return vaild;
        }

        public void setVaild(Boolean vaild) {
            this.vaild = vaild;
        }

        public Integer getCreateTime() {
            return createTime;
        }

        public void setCreateTime(Integer createTime) {
            this.createTime = createTime;
        }
    }
}
